
const initState = () => {
    return {
        profileData: {
            isShow: false,
            cardTransition: "",
            userName: "",
            isReadonly: true,
            editBtn: require('@/assets/images/profile/pc/editBtn.png'),
            signOutStep: 1,
        },
        password: {
            isShow: false,
            cardTransition: "",
            title: "Change Account Password",
            desc: "For safety reason, please verify your current Enchi.io account password.",
            btn: "Next",
            password: {
                title: "Password: ",
                placeholder: "Password",
                tip: "Please enter your password.",
                asyncTip: "Incorrect password.", //动态校验提示
                value: "",
                name: "password",
                type: "password",
            },
        },
    };
};

const state = initState();

const mutations = {
    //打开个人资料弹窗
    openProfilePop(state) {
        state.profileData.cardTransition = 'contentEnterBottom';
        state.profileData.isShow = true;
        state.profileData.signOutStep = 1;
    },
    //关闭个人资料弹窗
    closeProfilePop(state, type) {
        state.profileData.cardTransition = type ? type : 'contentLeaveBottom';
        state.profileData.isShow = false;
    },
    resetState(state) {
        Object.assign(state, initState());
    },
};

const actions = {

};

const getters = {};

export default {
    namespaced: true,
    state,
    getters,
    mutations,
    actions
};